import { request } from "@/utils/service"

export interface IAdPicture {
  id?: number
  picUri: string
  clickUri: string
  active: boolean
}

export interface ICreateAdPictureDataApi {
  picUri: string
  clickUri: string
}

export interface IGetAdPictureListDataApi {
  pageNum: number
  pageSize: number
}

export function createAdPicture(data: ICreateAdPictureDataApi) {
  return request({
    url: "/travel/manage/ad/picture/create",
    method: "post",
    data
  })
}

export function getAdPictureList(params: IGetAdPictureListDataApi) {
  return request({
    url: "/travel/manage/ad/picture/list",
    method: "get",
    params
  })
}

export function deleteAdPicture(id: number) {
  return request({
    url: "/travel/manage/ad/picture/delete/" + id,
    method: "delete"
  })
}

export function acitveAdPicture(id: number) {
  return request({
    url: "/travel/manage/ad/picture/active/" + id,
    method: "put"
  })
}

export function deacitvateAdPicture(id: number) {
  return request({
    url: "/travel/manage/ad/picture/deacitvate/" + id,
    method: "put"
  })
}
